#include <iostream>
using namespace std;

signed main()
{
    int n,ans = 0,a = 0,t;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>t;
        if(t>a)    ans += (t-a)*6;
        else    ans += (a-t)*4;
        ans += 5;
        a = t;
    }
    cout<<ans<<"\n";
    return 0;
}
